<html>
<head><meta charset="utf-8"><title>Yet another auto import bug · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html">Yet another auto import bug</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="187399744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187399744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187399744">(Feb 04 2020 at 21:01)</a>:</h4>
<p>I've spotted another auto import bug, but fail to reproduce it with the test fixture.</p>
<p>The bug: create a project with a name-that-contains-dashes.<br>
Have a <code>main.rs</code> and a struct defined in <code>lib.rs</code>. Try to auto import the struct into the <code>main.rs</code>.<br>
Expected: <code>use name_that_contains_dashes::Foo</code><br>
Actual:   <code>use name-that-contains-dashes::Foo</code> // this won't compile</p>
<p>When I try to add a test fixture in the <code>find_path.rs</code> test module, something like:</p>
<div class="codehilite"><pre><span></span><span class="cp">#[test]</span><span class="w"></span>
<span class="k">fn</span> <span class="nf">zzz</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">code</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">r</span><span class="err">#</span><span class="s">&quot;</span>
<span class="s">        //- /main.rs crate:main deps:std-with-dashes</span>
<span class="s">        &lt;|&gt;</span>
<span class="s">        //- /std.rs crate:std-with-dashes</span>
<span class="s">        pub struct S;</span>
<span class="s">    &quot;</span><span class="err">#</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="n">check_found_path</span><span class="p">(</span><span class="n">code</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;std-with-dashes::S&quot;</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>it panics despite the import form I use.</p>
<p>I've failed to create a snippet without <code>deps</code> due to the same reason and don't really want to dive into the code of the fixtures yet.<br>
Do you have any ideas on how can I create a proper test case for the bug?</p>



<a name="187400094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187400094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187400094">(Feb 04 2020 at 21:05)</a>:</h4>
<p>If I use <code>deps:std_with_dashes</code> and the corresponding crate name everywhere in the fixture, it works so I suspect that it's a bit too late to use the dashes form in those tests and I should create this test elsewhere.</p>



<a name="187406678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187406678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187406678">(Feb 04 2020 at 22:18)</a>:</h4>
<p>does our name resolution actually work with that <code>name_that_contains_dashes</code>? I suspect we just don't handle that. The autoimport algorithm just uses the name from the extern prelude; that should already be a valid identifier</p>



<a name="187408038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187408038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187408038">(Feb 04 2020 at 22:37)</a>:</h4>
<p>I don't get any completion for those structs but can navigate to them.<br>
Can also find them with <code>Cmd + T</code> shortcut, so some part of the functionality is there.</p>



<a name="187413250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187413250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187413250">(Feb 05 2020 at 00:01)</a>:</h4>
<p>I <em>think</em> we should add assert to <code>CrateGraph</code> that crate names do not have dashes</p>



<a name="187413261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187413261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187413261">(Feb 05 2020 at 00:01)</a>:</h4>
<p>Or, more specifically, that they are lexed as valid rust identifiers</p>



<a name="187434029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187434029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187434029">(Feb 05 2020 at 08:22)</a>:</h4>
<p>So it looks like we should adjust the names somewhere before storing? I wonder where is the place in the code, same <code>CrageGraph</code>?</p>



<a name="187434302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187434302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187434302">(Feb 05 2020 at 08:28)</a>:</h4>
<p>I <em>think</em> we should get names with underscroes from <code>cargo metadata</code>, so we don't need to adjust them. Rather, it's a precondition</p>



<a name="187434313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187434313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187434313">(Feb 05 2020 at 08:29)</a>:</h4>
<p>However, adding <code>struct CrateName(SmolStr)</code> which asserts the precondition in ctor would be useful</p>



<a name="187434818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187434818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187434818">(Feb 05 2020 at 08:39)</a>:</h4>
<blockquote>
<p>I think we should get names with underscroes from cargo metadata, so we don't need to adjust them. Rather, it's a precondition</p>
</blockquote>
<p>Looks like it's not true, not for the project itself at least.<br>
This is the output of the <code>cargo metadata</code> run on the empty project created with <code>cargo new test-the-dashes</code>:</p>
<div class="codehilite"><pre><span></span>{&quot;packages&quot;:[{&quot;name&quot;:&quot;test-the-dashes&quot;,&quot;version&quot;:&quot;0.1.0&quot;,&quot;id&quot;:&quot;test-the-dashes 0.1.0 (path+file:///Users/someonetoignore/Downloads/tmp_dir/test-the-dashes)&quot;,&quot;license&quot;:null,&quot;license_file&quot;:null,&quot;description&quot;:null,&quot;source&quot;:null,&quot;dependencies&quot;:[],&quot;targets&quot;:[{&quot;kind&quot;:[&quot;lib&quot;],&quot;crate_types&quot;:[&quot;lib&quot;],&quot;name&quot;:&quot;test-the-dashes&quot;,&quot;src_path&quot;:&quot;/Users/someonetoignore/Downloads/tmp_dir/test-the-dashes/src/lib.rs&quot;,&quot;edition&quot;:&quot;2018&quot;,&quot;doctest&quot;:true},{&quot;kind&quot;:[&quot;bin&quot;],&quot;crate_types&quot;:[&quot;bin&quot;],&quot;name&quot;:&quot;test-the-dashes&quot;,&quot;src_path&quot;:&quot;/Users/someonetoignore/Downloads/tmp_dir/test-the-dashes/src/main.rs&quot;,&quot;edition&quot;:&quot;2018&quot;,&quot;doctest&quot;:false}],&quot;features&quot;:{},&quot;manifest_path&quot;:&quot;/Users/someonetoignore/Downloads/tmp_dir/test-the-dashes/Cargo.toml&quot;,&quot;metadata&quot;:null,&quot;publish&quot;:null,&quot;authors&quot;:[&quot;Kirill Bulatov &lt;mail4score@gmail.com&gt;&quot;],&quot;categories&quot;:[],&quot;keywords&quot;:[],&quot;readme&quot;:null,&quot;repository&quot;:null,&quot;edition&quot;:&quot;2018&quot;,&quot;links&quot;:null}],&quot;workspace_members&quot;:[&quot;test-the-dashes 0.1.0 (path+file:///Users/someonetoignore/Downloads/tmp_dir/test-the-dashes)&quot;],&quot;resolve&quot;:{&quot;nodes&quot;:[{&quot;id&quot;:&quot;test-the-dashes 0.1.0 (path+file:///Users/someonetoignore/Downloads/tmp_dir/test-the-dashes)&quot;,&quot;dependencies&quot;:[],&quot;deps&quot;:[],&quot;features&quot;:[]}],&quot;root&quot;:&quot;test-the-dashes 0.1.0 (path+file:///Users/someonetoignore/Downloads/tmp_dir/test-the-dashes)&quot;},&quot;target_directory&quot;:&quot;/Users/someonetoignore/Downloads/tmp_dir/test-the-dashes/target&quot;,&quot;version&quot;:1,&quot;workspace_root&quot;:&quot;/Users/someonetoignore/Downloads/tmp_dir/test-the-dashes&quot;}
</pre></div>



<a name="187434998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187434998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187434998">(Feb 05 2020 at 08:43)</a>:</h4>
<p>It is indeed named this way in the <code>Cargo.toml</code>, with the dashes:</p>
<div class="codehilite"><pre><span></span>[package]
name = &quot;test-the-dashes&quot;
# ... snip
</pre></div>



<a name="187435004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435004">(Feb 05 2020 at 08:43)</a>:</h4>
<p>We should be using the name from the <code>dep</code> node:</p>
<div class="codehilite"><pre><span></span><span class="w">                </span><span class="s">&quot;deps&quot;</span>: <span class="p">[</span><span class="w"></span>
<span class="w">                    </span><span class="p">{</span><span class="w"></span>
<span class="w">                        </span><span class="s">&quot;name&quot;</span>: <span class="s">&quot;cfg_if&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">                        </span><span class="s">&quot;pkg&quot;</span>: <span class="s">&quot;cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">                        </span><span class="s">&quot;dep_kinds&quot;</span>: <span class="p">[</span><span class="w"></span>
<span class="w">                            </span><span class="p">{</span><span class="w"></span>
<span class="w">                                </span><span class="s">&quot;kind&quot;</span>: <span class="nc">null</span><span class="p">,</span><span class="w"></span>
<span class="w">                                </span><span class="s">&quot;target&quot;</span>: <span class="nc">null</span><span class="w"></span>
<span class="w">                            </span><span class="p">}</span><span class="w"></span>
<span class="w">                        </span><span class="p">]</span><span class="w"></span>
<span class="w">                    </span><span class="p">},</span><span class="w"></span>
</pre></div>



<a name="187435046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435046">(Feb 05 2020 at 08:43)</a>:</h4>
<p>The name in <code>package</code> is just a display name for the user, it's not the name the compiler sees, because it doesn't take underscores and <code>foo = { package = "bar"}</code> feature of <code>Cargo.toml</code>.</p>



<a name="187435096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435096">(Feb 05 2020 at 08:44)</a>:</h4>
<p>into account</p>



<a name="187435107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435107">(Feb 05 2020 at 08:45)</a>:</h4>
<p>Ah, maybe I was not explicit enough: there are no deps, this is the project itself that has the dashes and we try to import a struct from the project's <code>lib.rs</code> to the project's <code>main.rs</code>.</p>
<p>So the issue I'm talking about has nothing to do with the side crates at all.</p>



<a name="187435186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435186">(Feb 05 2020 at 08:46)</a>:</h4>
<p>oh wow</p>



<a name="187435196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435196">(Feb 05 2020 at 08:47)</a>:</h4>
<p>that's actually an interesting conceptual bug in cargo....</p>



<a name="187435212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435212">(Feb 05 2020 at 08:47)</a>:</h4>
<p>Like, ideally it should record crate dependency on itself, and do renaming, but it doesnt</p>



<a name="187435254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435254">(Feb 05 2020 at 08:48)</a>:</h4>
<p>And that's because <code>cargo metadata</code> is higher level than <code>crate_graph</code>, which creates all sorts of problems...</p>



<a name="187435261"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435261" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435261">(Feb 05 2020 at 08:48)</a>:</h4>
<p>Yes, we've stumbled onto something interesting here apparently.</p>
<p>I have no idea how to make it proper alas, but ready to help with some guidance.</p>



<a name="187435296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435296">(Feb 05 2020 at 08:49)</a>:</h4>
<p>yeah, let me check how we actually create dependency from a test to a <a href="http://lib.rs" target="_blank" title="http://lib.rs">lib.rs</a> ...</p>



<a name="187435689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435689">(Feb 05 2020 at 08:57)</a>:</h4>
<p>fond it <code>ra_project_model/src/lib.rs:280</code>, <code>pkg.name(&amp;cargo).into()</code> should do <code>-</code> -&gt; <code>_</code> conversion</p>



<a name="187435774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187435774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187435774">(Feb 05 2020 at 08:58)</a>:</h4>
<p>Or, rather,</p>
<div class="codehilite"><pre><span></span>pub fn add_dep(
        &amp;mut self,
        from: CrateId,
        name: SmolStr,
        to: CrateId,
    ) -&gt; Result&lt;(), CyclicDependenciesError&gt; {
</pre></div>


<p>Should be changed to </p>
<div class="codehilite"><pre><span></span>pub fn add_dep(
        &amp;mut self,
        from: CrateId,
        name: CrateName,
        to: CrateId,
    ) -&gt; Result&lt;(), CyclicDependenciesError&gt; {
</pre></div>



<a name="187436597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187436597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187436597">(Feb 05 2020 at 09:11)</a>:</h4>
<p>Thanks, I'll look at it.</p>



<a name="187436657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187436657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187436657">(Feb 05 2020 at 09:12)</a>:</h4>
<p>(I think you've inserted the same code snippet twice btw :D)</p>



<a name="187438190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187438190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kirill Bulatov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187438190">(Feb 05 2020 at 09:36)</a>:</h4>
<p>After I've applied the fix, not only imports but autocompletion also started to work, magic.</p>



<a name="187441945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187441945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187441945">(Feb 05 2020 at 10:39)</a>:</h4>
<blockquote>
<p>After I've applied the fix, not only imports but autocompletion also started to work, magic.</p>
</blockquote>
<p>It's actually interesting how complexity and synergy emerges over time in an IDE. It's typical that fixing one things can accidentally make many different things better. Or how you can sometimes compile many small features into a complex and powerful feature. Love when it happens. Definitely prefer this to futzing with rollup :D</p>



<a name="187442183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Yet%20another%20auto%20import%20bug/near/187442183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Yet.20another.20auto.20import.20bug.html#187442183">(Feb 05 2020 at 10:43)</a>:</h4>
<p>;( yeah, damn rollup, hate it</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>